// tab切换 
const tabBox = document.querySelectorAll('.top span')
for (let i = 0; i < tabBox.length; i++) {
  tabBox[i].addEventListener('click', function () {

    for (let t = 0; t < tabBox.length; t++) {
      tabBox[t].className = ''
    }
    this.className = 'active'
  })

}


const guanzhu = document.querySelectorAll('.hot .tab .right')
console.log(guanzhu);
const attention = document.querySelector('.attention')
console.log(attention);
for (let i = 0; i < guanzhu.length; i++) {
  guanzhu[i].addEventListener('click', function () {

    if (guanzhu[i].innerHTML == "关注") {
      guanzhu[i].innerHTML = '已关注'

      attention.style.display = 'block'
      attention.innerHTML = '关注成功'
      setTimeout(() => {
        attention.style.display = 'none'
      }, 1000);
    } else if (guanzhu[i].innerHTML == "已关注") {
      guanzhu[i].innerHTML = '关注'

      attention.style.display = 'block'
      attention.innerHTML = '取消关注'
      setTimeout(() => {
        attention.style.display = 'none'
      }, 1000);
    }

  })
}
